/**
      <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <2011>  <André Mendes de Oliveira Paiva>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  
 */

package estrutura.hashtable;
import estrutura.Aresta;


public class ArestaHash extends Aresta {

    private int idNoOrigem;
    private int idNoDestino;
    private boolean ativo;
    public static final int INDICE_NO_VAZIO = -1;

    public ArestaHash() {
        this(null, INDICE_NO_VAZIO, INDICE_NO_VAZIO);
    }

    public ArestaHash(Object rotulo, int idNoOrigem, int idNoDestino, int peso) {
        super(rotulo, peso);
        this.setAtivo(true);
        setIdNoOrigem(idNoOrigem);
        setIdNoDestino(idNoDestino);
    }

    public ArestaHash(Object rotulo, int idNoOrigem, int idNoDestino) {
        this(rotulo, idNoOrigem, idNoDestino, 0);
    }
    public ArestaHash(Object rotulo, int idNoOrigem) {
        this(rotulo, idNoOrigem, INDICE_NO_VAZIO);
    }
    public ArestaHash(int idNoOrigem, int idNoDestino) {
        this(null, idNoOrigem, idNoDestino);
    }
    public ArestaHash(Object rotulo) {
        this(rotulo, INDICE_NO_VAZIO, INDICE_NO_VAZIO);
    }

    
    @Override
    public String toString() {
        return "ID Nó Origem: " + this.getIdNoOrigem() + " - ID Nó Destino: " + this.getIdNoDestino() + super.toString();
    }

    @Override
    public void imprimir() {
        System.out.println(this.toString());
    }

    /**
     * @return o idNoOrigem
     */
    public int getIdNoOrigem() {
        return idNoOrigem;
    }

    /**
     * @param indNoOrigem setar o indNoOrigem
     */
    public void setIdNoOrigem(int idNoOrigem) {
        this.idNoOrigem = idNoOrigem;
    }

    /**
     * @return o idNoDestino
     */
    public int getIdNoDestino() {
        return idNoDestino;
    }

    /**
     * @param idNoDestino para setar o idNoDestino 
     */
    public void setIdNoDestino(int idNoDestino) {
        this.idNoDestino = idNoDestino;
    }
    public void setAtivo(boolean ativo)
    {
      this.ativo = ativo;
    }

    public boolean getAtivo()
    {
      return this.ativo;
    }

}

